package com.daoeping.action;

import java.sql.Timestamp;

import com.daoeping.data.Bzn_question;
import com.daoeping.data.Bzn_questioncomm;
import com.daoeping.domain.JsonData;
import com.daoeping.domain.Page;
import com.daoeping.domain.TableData;
import com.daoeping.service.Bzn_questioncommService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class Bzn_questioncommAction extends ActionSupport{
	private Bzn_questioncommService bzn_questioncommService;
	private Bzn_questioncomm bzn_questioncomm;
	private Page page;
	private TableData tableData;
	private JsonData jsonData;
	
	public Page getPage() {
		return page;
	}
	public void setPage(Page page) {
		this.page = page;
	}
	public TableData getTableData() {
		return tableData;
	}
	public void setTableData(TableData tableData) {
		this.tableData = tableData;
	}
	public JsonData getJsonData() {
		return jsonData;
	}
	public void setJsonData(JsonData jsonData) {
		this.jsonData = jsonData;
	}
	public Bzn_questioncommService getBzn_questioncommService() {
		return bzn_questioncommService;
	}
	public void setBzn_questioncommService(
			Bzn_questioncommService bzn_questioncommService) {
		this.bzn_questioncommService = bzn_questioncommService;
	}
	public Bzn_questioncomm getBzn_questioncomm() {
		return bzn_questioncomm;
	}
	public void setBzn_questioncomm(Bzn_questioncomm bzn_questioncomm) {
		this.bzn_questioncomm = bzn_questioncomm;
	}
	public String addBzn_questioncomm(){
		bzn_questioncomm.setCreateDatetime(new Timestamp(System.currentTimeMillis()));
		if(bzn_questioncommService.addBzn_questioncomm(bzn_questioncomm)){
			return "addBzn_questioncomm";
		}else{
			return "exception";
		}
	}
	public String findAllBzn_questioncommByPage(){
		Bzn_question bzn_question = (Bzn_question) ActionContext.getContext().getSession().get("question");
		jsonData = bzn_questioncommService.findAllBzn_questioncommByPage(page, tableData, bzn_question);
		return "findAllBzn_questioncommByPage";
	}
}
